@height: 24px;
@line-height: 24px;
@gap: 16px;
@gap-sm: 8px;

.data-entry {
  height: 100%;

  :global {
    .ant-tabs-left.ant-tabs-card {
      height: 100%;

      .ant-tabs-nav {
        height: 100%;
        min-width: 40px;

        .ant-tabs-tab {
          flex: 0 0 80px;
          font-size: 12px;
          writing-mode: vertical-lr;
          border-radius: 0;

          + .ant-tabs-tab {
            margin-top: 0;
          }
        }

        .ant-tabs-tab-active {
          background-color: @color-white;
          .ant-tabs-tab-btn {
            color: @primary-color;
          }
        }
      }
      .ant-tabs-content-holder {
        .ant-tabs-content {
          .ant-tabs-tabpane {
            padding-left: 0;
          }
        }
      }
    }
  }
}

.layout {
  width: 100%;
  padding: @padding-md;
  display: grid;
  gap: @gap;

  :global {
    .ant-input-sm,
    .ant-input-number-sm,
    .ant-input-affix-wrapper,
    .ant-select-sm,
    .ant-checkbox-wrapper,
    .ant-radio-wrapper,
    .ant-radio-button-wrapper {
      height: @height;
      line-height: @line-height;
    }

    .ant-input-affix-wrapper {
      .ant-input-sm {
        height: 22px;
        line-height: 22px;
      }
    }

    .ant-input-number-sm,
    .ant-select-sm {
      width: 100%;
    }
  }
}

.label {
  line-height: @line-height;
}

.horizontal,
.inline {
  .label {
    flex: 0 0 5em;
    margin-right: @margin-lg;
    color: @text-color-first;
  }
}

.vertical {
  .label {
    flex: 1;
    margin-right: 0;
    color: @text-color-secondary;
  }
}

.children {
  display: flex;

  &.horizontal {
    .child-layout {
      width: 100%;
      display: grid;
      gap: @gap;
    }
  }

  &.vertical {
    flex-direction: column-reverse;
  }

  &.inline {
    .child-layout {
      flex: 1;
      width: 0;
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: @gap-sm;
    }
  }
}

.widget {
  display: flex;

  &.horizontal {
    align-items: center;
    .entry {
      &:not(.checkbox) {
        flex: 1;
        width: 0;
      }
    }
  }

  &.vertical {
    flex-direction: column-reverse;
  }

  &.inline {
    margin-right: @margin-md;
  }

  .warning {
    line-height: @line-height;
    color: @warning-color;
  }
}
